home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 27.zip
/
BS1 part 27
/
ImageMaster_d3.adf
/
piarc.lzh.parta
/
imiv24r.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-03-23
|
5KB
|
160 lines
/*
* IMIV24r.rexx a P.I. module to display the Image from Imagemaster
* or Image Professional on GVP's IV-24 in 24-bit color
*
*
* Written by: Barry Chalmers
* For: Black Belt Systems image processing series IM, IM F/c, and IP.
* Last Update: May 13th, 1992
* ---------------------------------------------------------------------------
* Revision: 1.00 Jan 17, 1992 - Initial implementation
* 1.01 May 8, 1992 - Pal resolutions;
* slightly faster;
* Requires IM version 9.11 or later.
* 1.02 May 13, 1992 - Bug fixed vertical PAL size got turned on
* in non-PAL setup;
* Clearer description of 'mode' default.
*/
call pragma('stack',20000);
/*
* Default display mode - This is not usually changed by the user
* but the program is capable of it
*/
themode = 0; /* 0 = Leave unchanged */
/* 1 = Hi-scan (non-interlaced) */
/* 2 = Video scan rate (interlaced) */
/*
* Always include this block of code which loads the libraries:
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate this module without the library - sorry!';
exit 10;
end;
end;
/*
* Always include this block of code which automatically assigns the ARexx
* port to the image processor that is running (there are several choices!)
*/
prtnme = 'IP_Port'; /* assume Image Professional */
if show('P','IP_Port') = 0 then do
if show('P','IM_Port') = 0 then do
say "Can't find image processor's ARexx port!!!"; /* not running? */
say "This script requires IP, IM or IM F/c to run!";
exit(20);
end;
else do
prtnme = 'IM_Port'; /* Imagemaster or Imagemaster F/c */
end;
end;
/*
* This code attempts to read a file called "picmdpath" from REXX:
* If it can't find it, the script will assume that the commands
* associated with this PI Module are in "c:". If the file exists,
* the script will look in the path that is specified in the file.
* If you create this file, you MUST put a complete, correct path
* in it; if the commands are in a sub-directory, you have to put
* the trailing slash on the path (like, device:dir/).
*
*/
cmdpath = 'c:';
if open(fhandle,'rexx:picmdpath','read') then /* open the file */
do
cmdpath = readln(fhandle);
call close(fhandle); /* close the file */
end
/*
* The function-specific portion of the script begins here:
* --------------------------------------------------------
*/
address(prtnme); /* communicate with image processor we found */
options results;
'pal';
pal = result;
options;
if pal > 0 then
do
h1 = 256;
h2 = 280;
h3 = 512;
h4 = 566;
end
else
do
h1 = 200;
h2 = 240;
h3 = 400;
h4 = 482;
end
options results;
'gadgets "Lo-Res","320 to 384","Hi-Res","640 to 768"';
theres = result;
options;
if theres = 0 then do
address;
exit 0;
end
theres = theres - 1;
options results;
if theres = 0 then do
'gadgets "Show non- Lace","320 x' h1 '","Show in Lace","320 x' h3 '"';
end
else do
'gadgets "Show non- Lace","640 x' h1 '","Show in Lace","640 x' h3 '"';
end
thelace = result;
options;
if thelace = 0 then do
address;
exit 0;
end
thelace = thelace - 1;
options results;
if theres = 0 & thelace = 0 then do
'gadgets "Show non- Overscan","320 x' h1 '","Show in Overscan","384 x' h2 '"';
end
if theres = 0 & thelace = 1 then do
'gadgets "Show non- Overscan","320 x' h3 '","Show in Overscan","384 x' h4 '"';
end
if theres = 1 & thelace = 0 then do
'gadgets "Show non- Overscan","640 x' h1 '","Show in Overscan","768 x' h2 '"';
end
if theres = 1 & thelace = 1 then do
'gadgets "Show non- Overscan","640 x' h3 '","Show in Overscan","768 x' h4 '"';
end
thescan = result;
options;
if thescan = 0 then do
address;
exit 0;
end
thescan = thescan - 1;
options results;
'current';
parse var result bname ',' bnum ',' brest
'jackin'; /* attach to image processor's internal data structure */
jackptr = result; /* fetch the return value from the std ARexx return */
options; /* disallow return values from further commands */
'lockimage '||bnum;
address command run cmdpath||'imiv24 '||jackptr||' '||theres||' '||thelace||' '||thescan||' '||themode||' '||pal;
'unlockimage '||bnum;
exit 0; /* Done. That's all there is to most PI Modules! */